<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
  <title>美食外卖平台</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  <style>
    :root {
      --primary: #FF6B6B;
      --secondary: #FFE8E8;
      --text: #333;
      --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
      --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
      --radius-lg: 20px;
      --radius-md: 12px;
      --transition: all 0.3s ease;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Helvetica Neue', system-ui;
    }

    body {
      background: #F8F9FA;
      color: var(--text);
      padding-bottom: 80px; /* 为底部导航预留空间 */
    }

    /* 顶部导航 */
    .header {
      position: fixed;
      top: 0;
      width: 100%;
      background: white;
      padding: 12px 20px;
      box-shadow: var(--shadow-sm);
      z-index: 1000;
    }

    .search-bar {
      display: flex;
      gap: 10px;
      max-width: 800px;
      margin: 0 auto;
      transition: var(--transition);
    }

    .search-input {
      flex: 1;
      padding: 12px 25px;
      border: 2px solid var(--primary);
      border-radius: 30px;
      font-size: 16px;
      transition: var(--transition);
    }

    .search-input:focus {
      outline: none;
      box-shadow: 0 0 10px rgba(255,107,107,0.3);
    }

    /* 分类导航 */
    .categories {
      display: flex;
      gap: 15px;
      padding: 90px 20px 20px;
      overflow-x: auto;
      scrollbar-width: none;
    }

    .categories::-webkit-scrollbar {
      display: none;
    }

    .category-card {
      min-width: 100px;
      text-align: center;
      padding: 15px;
      background: white;
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-sm);
      transition: var(--transition);
      cursor: pointer;
    }

    .category-card:hover {
      transform: translateY(-3px);
      box-shadow: var(--shadow-md);
    }

    .category-icon {
      font-size: 28px;
      color: var(--primary);
      margin-bottom: 8px;
    }

    /* 商家列表 */
    .restaurant-grid {
      display: grid;
      gap: 25px;
      padding: 20px;
      max-width: 1200px;
      margin: 0 auto;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .restaurant-card {
      background: white;
      border-radius: var(--radius-lg);
      overflow: hidden;
      box-shadow: var(--shadow-sm);
      transition: var(--transition);
      cursor: pointer;
      opacity: 0;
      transform: translateY(20px);
    }

    .restaurant-card:hover {
      transform: translateY(-5px);
      box-shadow: var(--shadow-md);
    }

    .card-image {
      width: 100%;
      height: 200px;
      object-fit: cover;
      border-bottom: 3px solid var(--primary);
    }

    .card-content {
      padding: 15px;
    }

    .card-content h3 {
      margin-bottom: 8px;
      color: var(--text);
    }

    .badge {
      background: var(--secondary);
      color: var(--primary);
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 12px;
      display: inline-block;
      margin: 5px 0;
      font-weight: 500;
    }

    /* 底部导航 */
    .bottom-nav {
      position: fixed;
      bottom: -65px;
      width: 100%;
      background: white;
      display: flex;
      justify-content: space-around;
      padding: 15px 0;
      box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
      z-index: 1001;
      transition: transform 0.3s ease;
    }

    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
      color: #666;
      transition: var(--transition);
      text-decoration: none;
      font-size: 14px;
    }

    .nav-item i {
      font-size: 20px;
    }

    .nav-item.active {
      color: var(--primary);
      transform: translateY(-5px);
    }

    /* 登录提示条 */
    .login-prompt {
      position: fixed;
      bottom: 70px; /* 在导航栏上方 */
      left: 0;
      right: 0;
      background: rgba(0,0,0,0.95);
      color: white;
      padding: 12px 20px;
      display: none;
      align-items: center;
      justify-content: space-between;
      z-index: 1000; /* 在导航栏下方 */
      animation: slideUp 0.3s ease-out;
      border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .login-content {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 14px;
    }

    .login-content i {
      color: var(--primary);
    }

    .login-button {
      background: var(--primary);
      color: white;
      padding: 8px 25px;
      border-radius: 20px;
      text-decoration: none;
      font-weight: 500;
      transition: var(--transition);
      white-space: nowrap;
      font-size: 14px;
      border: 2px solid transparent;
    }

    .login-button:hover {
      background: white;
      color: var(--primary);
      border-color: var(--primary);
    }

    @keyframes slideUp {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }

    @media (min-width: 768px) {
      .card-image {
        height: 250px;
      }

      .categories {
        justify-content: center;
        flex-wrap: wrap;
      }

      .login-prompt {
        max-width: 480px;
        margin: 0 auto;
        bottom: 80px;
        border-radius: var(--radius-md);
      }
    }

    @media (max-width: 480px) {
      .search-input {
        padding: 10px 20px;
      }

      .restaurant-grid {
        grid-template-columns: 1fr;
      }

      .login-content span {
        font-size: 13px;
      }

      .login-button {
        padding: 8px 20px;
      }

      .bottom-nav {
        padding: 12px 0;

      }

      .nav-item {
        font-size: 12px;
      }

      .nav-item i {
        font-size: 18px;
      }
    }
  </style>
</head>
<body>
<!-- 顶部搜索栏 -->
<header class="header">
  <div class="search-bar">
    <input type="text" class="search-input" placeholder="🔍 搜索美食、商家...">
  </div>
</header>

<!-- 分类导航 -->
<nav class="categories">
  <div class="category-card">
    <i class="fas fa-hamburger category-icon"></i>
    <div>快餐简餐</div>
  </div>
  <div class="category-card">
    <i class="fas fa-coffee category-icon"></i>
    <div>咖啡饮品</div>
  </div>
  <div class="category-card">
    <i class="fas fa-birthday-cake category-icon"></i>
    <div>甜品烘焙</div>
  </div>
  <div class="category-card">
    <i class="fas fa-utensils category-icon"></i>
    <div>中式餐饮</div>
  </div>
</nav>

<!-- 商家列表 -->
<main class="restaurant-grid">
  <!-- 商家卡片示例 -->
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>

  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <!-- 其他商家卡片结构相同... -->
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
  <article class="restaurant-card">
    <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"
         class="card-image"
         alt="汉堡套餐">
    <div class="card-content">
      <h3>汉堡大师</h3>
      <div class="badge">🔥 人气爆款</div>
      <p>⭐ 4.9 (2000+评价)</p>
      <p>🕒 30分钟送达 | 💰 配送费 ¥3</p>
    </div>
  </article>
</main>

<!-- 登录提示条 -->
<div class="login-prompt" id="loginPrompt">
  <div class="login-content">
    <i class="fas fa-exclamation-circle"></i>
    <span>登录后可以查看订单、收藏和优惠券</span>
  </div>
  <a href="It'smine.html" class="login-button">立即登录</a>
</div>

<!-- 底部导航 -->
<nav class="bottom-nav">
  <a href="#" class="nav-item active">
    <i class="fas fa-home"></i>
    <span>首页</span>
  </a>
  <a href="Found.html" class="nav-item">
    <i class="fas fa-search"></i>
    <span>发现</span>
  </a>
  <a href="ShoppingCart.html" class="nav-item">
    <i class="fas fa-shopping-cart"></i>
    <span>购物车</span>
  </a>
  <a href="It'smine.html" class="nav-item">
    <i class="fas fa-user"></i>
    <span>我的</span>
  </a>
</nav>

<script>
  document.addEventListener('DOMContentLoaded', () => {
    // 卡片加载动画
    const cards = document.querySelectorAll('.restaurant-card');
    cards.forEach((card, index) => {
      setTimeout(() => {
        card.style.opacity = '1';
        card.style.transform = 'translateY(0)';
      }, index * 150);
    });

    // 导航切换
    const navItems = document.querySelectorAll('.nav-item');
    navItems.forEach(item => {
      item.addEventListener('click', (e) => {
        navItems.forEach(nav => nav.classList.remove('active'));
        item.classList.add('active');
      });
    });

    // 登录状态处理
    const token = sessionStorage.getItem('token');
    const loginPrompt = document.getElementById('loginPrompt');
    const bottomNav = document.querySelector('.bottom-nav');

    if (!token) {
      loginPrompt.style.display = 'flex';
      // 动态计算提示条高度
      const promptHeight = loginPrompt.offsetHeight;
      bottomNav.style.transform = `translateY(-${promptHeight}px)`;
    }else{
      bottomNav.style.bottom = '0'
    }

    // 窗口调整时保持布局
    window.addEventListener('resize', () => {
      if (!token) {
        const promptHeight = loginPrompt.offsetHeight;
        bottomNav.style.transform = `translateY(-${promptHeight}px)`;
      }
    });
  });
</script>
</body>
</html>
